// OGoMojo
// Whitemice.MOGI.RPC2.PhoneNumber
// License: LGPL
// Copyright: Whitemice Consulting, 2006
// Author(s): Adam Tauno Williams (awilliam@whitemice.org)
using System;
using CookComputing.XmlRpc;

namespace Whitemice.MOGI.RPC2 {
	/// \brief Implements IPhoneNumber
	public class PhoneNumber : SubDocument, IPhoneNumber {
		/// \brief Constructor
		/// \param document An XmlRpcStruct document
		/// \param parentDocument The document that owns the phone number
		/// \param typeAbbrev The type of the phone number
		/// \param server Reference to server object		
		public PhoneNumber(XmlRpcStruct document, IDocument parentDocument, string typeAbbrev, Server server) :
			base(document, parentDocument, typeAbbrev, server) {
		}
		
		/// \brief Accessor for the number value		
		public string DialNumber {
			get {
				return (string)document["number"];
			}
			set {
				document["number"] = value;
			}
		}
		
		/// \brief Accessor for the info value		
		public string Info {
			get {
				return (string)document["info"];
			}
			set {
				document["info"] = value;
			}
		}
		
		/// \brief Provides the unique name of the object		
		public override string Name {
			get {
				return "Documet/PhoneNumber/" + document["telephoneId"];
			}
		}
		
		public override bool Filled
		{
			get { return true; }
		}
	}
}